<template>
  <div class="h-full flex flex-col">
    <a-card class="image-wrapper">
      <image-manage>
        <a-button type="primary" class="float-right">图片管理</a-button>
      </image-manage>
    </a-card>

    <data class="flex-1">
      <editor-wrapper :tags="tags" :article="article" />
    </data>
  </div>
</template>

<script>
export default {
  name: 'HandleArticle',
  layout: 'admin',
  async asyncData(context) {
    const { data: tags } = await context.$apis.admin.getTags()
    const { data: article } = await context.$apis.admin.getArticleById({
      id: context.params.id,
    })
    return {
      tags,
      article,
    }
  },
}
</script>

<style lang="scss" scoped>
.image-wrapper {
  &::v-deep {
    .ant-card-body {
      padding: 12px 24px;
    }
  }
}
</style>
